package com.gao;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 测试解决编码问题
 *
 * @author GaoXi
 * @date 2021/8/16 19:13
 */
@Controller
public class UtfController {

    @GetMapping("getTest")
    public ModelAndView getTest(String name) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("name", name);
        modelAndView.setViewName("success");
        return modelAndView;
    }

    @PostMapping("addUser")
    public ModelAndView addUser(String userName){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("name", userName);
        modelAndView.setViewName("success");
        return modelAndView;
    }



}
